home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Orlando_1993 / Devcon93.2 / Installer / Installer2.16 / installer.doc < prev    next >
Encoding:
Text File  |  1993-01-12  |  62.4 KB  |  1,850 lines

  1.  
  2.  
  3.             Documentation for 2.16 Installer 
  4.             Last Revised: January 12th, 1993
  5.  
  6.  
  7. Contents:
  8.  
  9.     1 Background
  10.  
  11.     2 Overview
  12.       2.1  Standard Invocation
  13.       2.2  Initial Actions
  14.       2.3  Startup Screens
  15.       2.4  Installation Actions
  16.  
  17.     3 Scripting Language Tutorial
  18.       3.1  Basic Elements
  19.       3.2  Escape Characters
  20.       3.3  Symbols (Variables)
  21.       3.4  Types of Symbols
  22.       3.5  Statements
  23.       3.6  Data Types
  24.       3.7  Special Features
  25.       3.8  Miscellaneous
  26.  
  27.     4 Installer Language Reference
  28.       4.1  Notes
  29.       4.2  Statements
  30.       4.3  Control Statements
  31.       4.4  Debugging Statements
  32.       4.5  User-Defined Procedures
  33.       4.6  Functions
  34.       4.7  Summary of Parameters
  35.       4.8  Pre-Defined Variables
  36.  
  37.     5 Installer Language Quick Reference
  38.       5.1  Overview
  39.       5.2  Quick Language Overview
  40.       5.3  Pre-Defined Variables
  41.       5.4  Default Help String Variables
  42.       5.5  Statements
  43.       5.6  Functions
  44.  
  45.  
  46.                 Section 1: Background
  47.  
  48. Installation of applications from floppy disks onto a hard disk has proven to be
  49. a very inconsistent and often frustrating endeavor for most end-users.  This has
  50. been caused by many factors, some of which are:
  51.  
  52.     a. Many products do not come with any utility or script to install an
  53.        application on a hard disk.
  54.  
  55.     b. Many products assume a great deal of familiarity with the startup process
  56.        of the Amiga and applications, including assigns, device names (as
  57.        opposed to volume names), etc.
  58.  
  59.     c. The installation scripts or utilities included with some products vary
  60.        widely in their ability to deal with different environments and systems.
  61.  
  62. About a year ago, Commodore set out to remedy this situation, by developing a
  63. standard tool that developers can include with their products, which provides
  64. the user with a standard way to install applications.  The Installer's features
  65. were based on a number of assumptions:
  66.  
  67.     a. Installation requirements vary widely---some need assigns, some need new
  68.        drawers created, some install pieces in system drawers such as a fonts
  69.        drawer, a `product' might be just an upgrade and the installation must
  70.        check to see which version (if any) they currently have installed, etc.
  71.  
  72.     b. Different users have different levels of comfort and expertise when
  73.        attempting to install software, and the Installer should be able to
  74.        accommodate a range of users.  Many installation scripts assume a great
  75.        deal of knowledge, which is very intimidating for a novice.
  76.  
  77.     c. The installer tool must be very flexible internally, but present a
  78.        consistent pleasant graphical user interface to the user that only shows
  79.        the user information or prompts that they need to see.  The Installer
  80.        should be resolution, color and font sensitive.
  81.  
  82.     d. Writing scripts to install an application will require some effort, but
  83.        certainly no more than writing an AmigaDOS shell script equivalent, and
  84.        the resulting installation procedure will be more friendly, flexible, and
  85.        much better looking than the latter.
  86.  
  87.     e. Not everyone will be running 2.0 by the time the tool becomes available,
  88.        so it must run under 1.3 and 2.0.
  89.  
  90.  
  91.                 Section 2: Overview
  92.  
  93. The Installer is a script driven program, that presents a consistent
  94. installation environment to the end user.  The user never sees the script.
  95. Instead they are presented with simple yes/no choices, and may be asked to
  96. specify locations to put things on their system.
  97.  
  98. To accommodate different user levels, they can choose to run the tool in novice,
  99. average or expert modes.  Scripts can include help text to explain any choices
  100. that the user must make.  At each step the user is given the option of aborting
  101. the installation.
  102.  
  103.  
  104.  
  105.  
  106. 2.1  Standard Invocation
  107.  
  108. The Installer program requires a 10000 byte stack.  Project icons for Installer
  109. script should indicate a stack size of 10000.  If starting Installer from a CLI,
  110. first do a "Stack 10000".
  111.  
  112. The Installer is normally started up from a Workbench Project icon which has the
  113. same name as the script to interpret and has a default tool of Installer.
  114. A number of tooltypes are available to modify the operation of the Installer:
  115.  
  116.     SCRIPT - Path to a script file to be used with Installer.
  117.  
  118.     APPNAME - Name of the application being installed (appears in the startup
  119.               screen).  This MUST be given.
  120.  
  121.     MINUSER - The minimum possible operation mode of the installation for a
  122.               script.  This will be either NOVICE (all decisions made by
  123.               Installer), AVERAGE (only important decisions made by user) or
  124.               EXPERT (user confirms almost all actions).  The Default is NOVICE.
  125.  
  126.     DEFUSER - Indicates which operation mode button should be initially
  127.               selected.  Same values as MINUSER, with the value of the MINUSER
  128.               tooltype being the default (which will be NOVICE if MINUSER not
  129.               defined).
  130.  
  131.     NOPRINT - If set to FALSE, then the printer option in the  log file settings
  132.               will be ghosted.
  133.  
  134.     PRETEND - If set to FALSE, indicates that PRETEND mode not available for
  135.               this script.
  136.  
  137.     LANGUAGE - Is used to set the variable @language (default for @language is
  138.                "english".  Installer will attempt to load the corresponding
  139.                language catalog to allow for language localization.
  140.  
  141.     LOGFILE - The name of the log file that the Installer should use.  This must
  142.               be a full path.  The default is "install_log_file".
  143.  
  144.     LOG - In NOVICE mode the default is to create a log file (to disk).  If this
  145.           tooltype is set to FALSE, the creation of a log file in NOVICE mode is
  146.           disabled.
  147.  
  148. Although the installer can be started up from the CLI, that is not the
  149. recommended mode.  CLI invocation is provided mainly for script debugging
  150. purposes.  The command template is:
  151.  
  152. SCRIPT/k,APPNAME,MINUSER,DEFUSER,LOGFILE,NOLOG/s,NOPRETEND/s,
  153. NOPRINT/s,LANGUAGE/k
  154.  
  155.  
  156.  
  157.  
  158. 2.2  Initial Actions
  159.  
  160. The first thing the installer does is compile the installation script into an
  161. internal format that can be easily interpreted.  If there are syntax errors in
  162. the script, they will be caught during this phase.
  163.  
  164.  
  165.  
  166.  
  167. 2.3  Startup Screens
  168.  
  169. Next, the Installer asks the user what Installation Mode to run in, either
  170. NOVICE, AVERAGE or EXPERT.  If the user chooses NOVICE, they will not be asked
  171. any more questions (although they may be requested to do things).  In the other
  172. user levels, a second display appears asking the user if he wants to install
  173. "for real" or "do a dry run", and if he wants a transcription of the
  174. installation process written to either a file or printer.
  175.  
  176.  
  177.  
  178.  
  179. 2.4  Installation Actions
  180.  
  181. Now the Installer interprets its internal version of the script.  Any commands
  182. that call for a user interface will cause the Installer to algorithmically
  183. generate a display, always including buttons to allow for context sensitive help
  184. and aborting the installation. 
  185.  
  186.  
  187.             Section 3: Scripting Language Tutorial
  188.  
  189. The script language of the Installer is based on LISP.  It is not difficult to
  190. learn, but requires a lot of parentheses.  An Installer script can easily be
  191. made to look very readable.
  192.  
  193.  
  194.  
  195.  
  196. 3.1  Basic Elements
  197.  
  198. The basic elements of the installer language are:
  199.  
  200.     Type                  Example
  201.     ----                  -------
  202.     decimal integers      5
  203.     hexadecimal integers  $a000
  204.     binary integers       %0010010
  205.     strings               "Hello" or 'Hello'
  206.     symbols               x
  207.     comments              ; this is a comment
  208.     ( )                   for statement definition
  209.     space                 delimits symbols
  210.      (or any white space)
  211.  
  212.  
  213.  
  214.  
  215. 3.2  Escape Characters
  216.  
  217. Escape characters are supported as in the C language:
  218.  
  219.     Escape
  220.     sequence  Produces
  221.     --------  --------
  222.     '\n'      newline character
  223.     '\r'      return character
  224.     '\t'      tab character
  225.     '\0'      a NUL character
  226.     '\"'      a double-quote
  227.     '\\'      a backslash
  228.  
  229.  
  230.  
  231.  
  232. 3.3  Symbols (Variables)
  233.  
  234. A symbol is any sequence of characters surrounded by spaces that is not a quoted
  235. string, an integer or a control character.  This means that symbols can have
  236. punctuation marks and other special characters in them.  The following are all
  237. valid symbols:
  238.  
  239.     x
  240.     total
  241.     this-is-a-symbol
  242.     **name**
  243.     @#__#@
  244.  
  245.  
  246.  
  247.  
  248. 3.4  Types of Symbols
  249.  
  250. There are three types of symbols:
  251.  
  252.     a. user-defined symbols.  These are created using the "set" function.
  253.  
  254.     b. built-in function names.  These include things like '+' and '*' as well
  255.        as textual names such as "delete" or "rename".
  256.  
  257.     c. special symbols.  These are variables which are created by the installer
  258.       before the script actually starts to run, and are used to tell the script
  259.       certain things about the environment. These symbols always begin with an
  260.       '@' sign.  An example is '@default-dest' which tells you the default
  261.       directory that was selected by the installer.
  262.  
  263.  
  264.  
  265.  
  266. 3.5  Statements
  267.  
  268. The format of a statement is:
  269.  
  270.     (operator <operand1> <operand2> ...)
  271.  
  272. A statement to assign the value '5' to the variable 'x' would be:
  273.  
  274.     (set x 5)
  275.  
  276. You can read this as "set x to 5".  Note that the variable 'x' does not have to
  277. be declared -- it is created by this statement.
  278.  
  279. Note that there is no difference between operators and functions -- the function
  280. 'set' and the arithmetic operator '+' are both used exactly the same way.
  281.  
  282. Combining statements: A statement can be used as the operand to another
  283. statement as follows:
  284.  
  285.     (set var (+ 3 5))
  286.  
  287. In this case, the statement '(+ 3 5)' is evaluated first, and the result is 8.
  288. You can think of this as having the '(+ 3 5)' part being replaced by an 8.
  289. So now we are left with:
  290.  
  291.     (set var 8)
  292.  
  293. which is the same form as the first example.
  294.  
  295. Note that the '(+ 3 5)' part actually produced a value: 8.  This is called the
  296. "result" of the statement.  Many statements return results, even some that might
  297. surprise you (such as "set" and "if").
  298.  
  299.  
  300.  
  301.  
  302. 3.6  Data Types
  303.  
  304. All data types in the installer are dynamic, that is to say the type of a
  305. variable is determined by the data that is in it.  So if you assign the string
  306. "Hello, World" to the variable 'x', then 'x' will be of type STRING.  Later you
  307. can assign an integer to 'x' and x will be of type INTEGER.  When using
  308. variables in expressions, the interpreter will attempt to convert to the proper
  309. type if possible.
  310.  
  311. Special forms: There are two exceptions to the form of a statement.  The first
  312. type is used for string substitution: If the first item in parentheses is a text
  313. string rather than a function name, the result of that clause is another string
  314. that is created by taking the original string and performing a "printf"-like
  315. formatting operation on it, using the other arguments of the statement as
  316. parameters to the formatting operation.
  317.  
  318. Thus the statement:
  319.  
  320.     ("My name is %s and I am %ld years old" "Mary" 5)
  321.  
  322. Becomes:
  323.  
  324.     "My name is Mary and I am 5 years old"
  325.  
  326. Note since the formatting operation uses the ROM "RawDoFmt" routine, decimal
  327. values must always be specified with "%ld" rather than "%d" (The interpreter
  328. always passes numeric quantities as longwords).  Note that a variable containing
  329. the string may be used rather than the string itself.
  330.  
  331. The second type of exception occurs if the elements in parentheses are
  332. themselves statements in parentheses.  In this case, the interpreter assumes
  333. that all the elements are statements to be executed sequentially.
  334.  
  335. For example, this statement sets the value of three different variables:
  336. "var1", "var2" and "var3".
  337.  
  338.     ((set var1 5) (set var2 6) (set var3 7))
  339.  
  340. What this feature does is allow the language to have a block structure, where an
  341. "if" statement can have multiple statements in its "then" or "else" clause.
  342. Note that the result of this statement will be the result of the last statement
  343. in the sequence.
  344.  
  345. Complex statements: Here is an example of how statements in the script language
  346. can be combined into complex expressions.  We will start with an "if" statement.
  347. The basic format of an "if" statement is:
  348.  
  349.     (if <condition> <then-statement> [<else-statement>])
  350.  
  351. The condition should be a statement which returns a value.  The "then" and
  352. optional "else" parts should be statements.  Note that if the "then" or "else"
  353. statements produce a result, then the "if" statement will also have this result.
  354.  
  355. Our first example is a rather strange one: Using an "if" statement to simulate
  356. a boolean "not" operator. (Note that there are easier ways in the script
  357. language to do this).
  358.  
  359.     (set flag 0)              ; set a flag to FALSE
  360.  
  361.     (set flag (if flag 0 1))  ; a Boolean NOT
  362.  
  363. Basically, the "if" statement tests the variable "flag".  If flag is non-zero,
  364. it produces the value "0".  Otherwise, the result is "1".  In either case,
  365. "flag" is set to the result of the "if" statement.
  366.  
  367. Now, let's plug some real statements into our "if" statement.
  368.  
  369.     (if flag                                ; conditional test
  370.         (message "'flag' was non-zero\n")   ; "then" clause.
  371.         (message "'flag' was zero\n")       ; "else" clause.
  372.     )                                       ; closing parenthesis
  373.  
  374. Note the style of the indenting.  This makes for an easier to read program.
  375.  
  376. Now, we'll add a real condition.  "=" tests for equality of the two items.
  377.  
  378.     (if (= a 2)                    ; conditional test
  379.         (message "a is 2\n")       ; "then" clause
  380.         (message "a is not 2\n")   ; "else" clause
  381.     )                              ; closing parenthesis
  382.  
  383. Finally, just to make things interesting, we'll make the "else" clause a
  384. compound statement.
  385.  
  386.     (if (= a 2)                           ; conditional test
  387.         (message "a is 2\n")              ; "then" clause
  388.         (    (message "a is not 2\n")      ; "else" compound statement
  389.             (set a 2)
  390.             (message "but it is now!\n")
  391.         )                                 ; end of compound statement
  392.     )                                     ; end of if
  393.  
  394.  
  395.  
  396.  
  397. 3.7  Special Features
  398.  
  399. When the Installer first starts up, it attempts to determine the "best" place to
  400. install the application.  Any volume named "WORK:" is given preference, as this
  401. is the standard way that an Amiga comes configured from Commodore.
  402.  
  403. There are two keyboard shortcuts.  Whenever there is a "Help" button active,
  404. pressing the HELP key will also bring up the help display.  Whenever there is an
  405. "Abort" button active, pressing ESC brings up the abort requester.  Also,
  406. whenever the installer is "busy", pressing ESC brings up the abort requester --
  407. there is text is the title bar to that effect.
  408.  
  409. If an application must have assigns or other actions performed during system
  410. boot, the Installer will add these to a file named "S:user-startup".
  411. The installer will then add the lines 
  412.  
  413.     if exists S:user-startup
  414.     execute S:user-startup
  415.     endif
  416.  
  417. to the user's "startup-sequence".  The Installer will attempt to determine the
  418. boot volume of the system when looking for the "startup-sequence" and can handle
  419. any AmigaDOS scripts executed from "startup-sequence" (up to 10 levels of
  420. nesting).
  421.  
  422. The Installer can create an assign to just a device, volume or logical
  423. assignment.  This comes in handy when you want to update an application which
  424. comes on a volume named "MyApp:", but the installed version is in a directory
  425. with the logical assign "MyApp:"!
  426.  
  427. The Installer always copies files in CLONE mode, meaning all the protection
  428. bits, filenotes and file dates are preserved.  When copying files the Installer
  429. gives a "fuelgauge" readout of the progress of the copy.
  430.  
  431. The Installer can find the version number of any executable file that has either
  432. a RomTag with an ID string (such as libraries and devices) or has a version
  433. string conforming to that given in the 1990 DevCon notes.  The Installer can
  434. also checksum files.  A separate utility named "instsum" is provided to
  435. determine a file's checksum for use with this feature.
  436.  
  437.  
  438.  
  439.  
  440. 3.8  Miscellaneous
  441.  
  442. To perform a set of actions on all the contents of a directory matching a
  443. pattern you can use the "foreach" operator.  To perform a set of actions on an
  444. explicit set of files, the following installer statements can be used as a
  445. template:
  446.  
  447.     (set n 0)
  448.     (while (set thisfile (select n "file1" "file2" "file3" ""))
  449.         (    (set n (+ n 1))
  450.             (... your stuff involving this file ...)
  451.         )
  452.     )
  453.  
  454. Note that an empty string is considered a FALSE value to any condition operator.
  455.  
  456. To run an external CLI command which normally requires user input, redirect the
  457. input from a file with the needed responses.  For example, to format a disk one
  458. could combine the statement shown below with a file which contains only a
  459. newline character.
  460.  
  461.     (run "format <nl_file drive DF0: name ToBeEmpty")
  462.  
  463.  
  464.             Section 4: Installer Language Reference
  465.  
  466.  
  467.  
  468.  
  469. 4.1  NOTES
  470.  
  471. a. When the script exits either by comming to the end or via the "exit"
  472. statement, a message will be displayed saying where the application was
  473. installed and where the logfile (if any) was written.  Note that you must store
  474. in "@default-dest" where you actually installed the application (see
  475. "@default-dest" below).
  476.  
  477. b. A newline character ('\n', 0x0a) will cause a line break when the installer
  478. performs word-wrapping.  A hard-space (ALT-space, 0xa0) will prevent a word
  479. break when the installer performs word-wrapping.  Also, quoted sections will be
  480. considered one word for word-wrapping purposes.  For example, if the following
  481. help text was used:
  482.  
  483.     "The disk name \"FrameZapper 2.0\" is needed to complete installation."
  484.  
  485. then the text "FrameZapper 2.0" will not have a word break before the "2".
  486.  
  487. c. The maximum size of a string in a script is 512 bytes.  The maximum size of
  488. any string variable is 10000 bytes.  If you need to create long help text for
  489. example, break it into 512 byte chunks and then use the automatic string
  490. concatenation ability of the installer to create the final, larger string.
  491. Also, don't overlook the the use of line continuation of strings in scripts
  492. to make your scripts more manageable.  If you ever find that the installer
  493. reports a stack overflow error, look to see if it caused by too many small
  494. strings being concatenated and merge them into larger blocks.
  495.  
  496. d. The "run" and "execute" statements only return the result of the command run
  497. or executed under 2.0; they always return 0 under 1.3.  If you must have some
  498. result under both 1.3 and 2.0, try this combo:
  499.  
  500.     # in the DOS script to execute:
  501.     failat 31
  502.     command
  503.     if error
  504.         setenv installer-result 10
  505.     else
  506.         if warn
  507.             setenv installer-result 5
  508.         else
  509.             setenv installer-result 0
  510.         endif
  511.     endif
  512.  
  513.     # in the installer script
  514.     (execute DOS-Script)
  515.     (set theResult (getenv "installer-result"))
  516.  
  517. e. Filename and directoryname wildcard patterns specified in a script must be no
  518. longer than 64 characters.
  519.  
  520.  
  521. 4.2  Statements
  522.  
  523. (set <varname> <value> [<varname2> <value2> ...])
  524.  
  525. Set the variable <varname> to the indicated value.  If <varname> does not exist
  526. it will be created.  Set returns the value of the last assignment.
  527.  
  528. Note: All variables are typeless, and any variable may be used wherever a string
  529. could be used.  All variables are global.
  530.  
  531. The "set" statement can be used to convert a string to an integer value:
  532.  
  533.     (set <integer-var> (+ <string-var>))
  534.  
  535. Use the "cat" statement to do the reverse.
  536.  
  537.  
  538. (makedir <name> <parameters>)
  539.  
  540. Creates a new directory.  Parameters:
  541.  
  542.     prompt - tell the user what's going to happen.
  543.     help - text of help message
  544.     infos - create an icon for directory
  545.     confirm - if this option is present, user will be prompted, else the
  546.               directory will be created silently.
  547.     safe - make directory even if in PRETEND mode
  548.  
  549.  
  550. (copyfiles <parameters>)
  551.  
  552. Copies one or more files from the install disk to a target directory.  Each file
  553. will be displayed with a checkmark next to the name indicating if the file
  554. should be copied or not.  Note that a write protected file is considered
  555. "delete protected" as well.  Parameters:
  556.  
  557.     prompt, help - as above
  558.     source - name of source directory or file
  559.     dest - name of destination directory, which is created if it doesn't exist
  560.            Note that both source and dest may be relative pathnames.
  561.     newname - if copying one file only, and file is to be renamed, this is the
  562.               new name
  563.     choices - a list of files/directories to be copied (optional)
  564.     all - all files/directories in the source directory should be copied
  565.     pattern - indicates that files/directories from the source dir matching a
  566.               pattern should be copied.  The pattern should be no more than 64
  567.               characters long.
  568.               Note that only one of "choices", "all" or "pattern" should be
  569.               used at any one time.
  570.     files - only copy files.  By default the installer will match and copy
  571.             subdirectories.
  572.     infos - switch to copy icons along with other files/directories
  573.     fonts - switch to not display ".font" files, yet still copy any that match
  574.             a directory that is being copied.
  575.     (optional <option> <option> ...) - dictates what will be considered a
  576.             failure on copying.
  577.             The first three options are mutually exclusive (they may not be
  578.             specified together).
  579.                 "fail" - installer aborts if could not copy (the default)
  580.                 "nofail" - installer continues if could not copy
  581.                 "oknodelete" - aborts if can't copy, unless reason was
  582.                                "delete protected"
  583.             The next two options may be used with any other "optional" options.
  584.                 "force" - unprotect destination
  585.                 "askuser" - ask user if the file should be unprotected (but not
  586.                             in novice)
  587.                 In the case of "askuser", the default for novice mode is an
  588.                 answer of "no".  Therefore, you may want to use "force" to make
  589.                 the novice mode default answer appear to be "yes".
  590.     (delopts <option> <option> ...) - removes options set by "optional"
  591.     confirm -  if this option is present, user will be prompted to indicate
  592.                which files are to be copied, else the files will be copied
  593.                silently.
  594.     safe - copy files even if in PRETEND mode.
  595.  
  596.  
  597. (copylib <parameters>)
  598.  
  599. Copies one file using version checking; i.e., it only overwrites an existing
  600. file if the new file has a higher version/revision number.  "Copylib" will
  601. create the destination directory as long as there is only one level missing.
  602. For example, copying to a non-existent "DEVS:midi" would create the directory
  603. "midi", but copying to "DEVS:midi/extra" where neither "midi" nor "extra" exists
  604. would fail.  Note that a write protected library file is considered "delete
  605. protected" as well.  Parameters:
  606.  
  607.     prompt, help - as above
  608.     source - name of source directory or file
  609.     dest - name of destination directory
  610.            Note that both source and dest may be relative pathnames.
  611.     newname - if copying one file only, and file is to be renamed,
  612.               this is the new name
  613.     infos - switch to copy icons along with other files
  614.     (optional <option> <option> ...) - dictates what will be considered a
  615.                                        failure on copying.
  616.         The first three options are mutually exclusive (they may not be
  617.             specified together).
  618.             "fail" - installer aborts if could not copy (the default)
  619.             "nofail" - installer continues if could not copy
  620.             "oknodelete" - aborts if can't copy, unless reason was
  621.                            "delete protected"
  622.         The next two options may be used with any other "optional" options.
  623.             "force" - unprotect destination
  624.             "askuser" - ask user if the file should be unprotected
  625.                         (but not in novice)
  626.             In the case of "askuser", the default for novice mode is an answer
  627.             of "no".  Therefore, you may want to use "force" to make the
  628.             novice mode default answer appear to be "yes".
  629.     (delopts <option> <option> ...) - removes options set by "optional"
  630.     confirm - user will be asked to confirm.  Note that an EXPERT user
  631.               will be able to overwrite a newer file with an older one.
  632.     safe - copy the file even if in PRETEND mode
  633.  
  634.  
  635. (startup <appname> <parameters>)
  636.  
  637. This command edits the "S:user-startup" file, which is executed by the user's
  638. startup-sequence (Installer will modify the user's startup- sequence if needed,
  639. although in a friendly way).  The "command" parameter is used to declare
  640. AmigaDOS command lines which will be executed.  The command lines are grouped by
  641. application, using the supplied argument "appname".  If there is already an
  642. entry in "S:user-startup" for that application, the new command lines will
  643. completely replace the old.  The command lines for other applications will not
  644. be affected.  Note: The prompt and help parameters for the "startup" statement
  645. are only used by the confirmation display to edit "user-startup".  This only
  646. happens in EXPERT mode.  Parameters:
  647.  
  648.     prompt, help - as above
  649.     command - used to declare an AmigaDOS command line to be
  650.               executed at system startup.
  651.  
  652.  
  653. (tooltype <parameters>)
  654.  
  655. Modify an icon's tool type.  Normally the new tool type values will be set up
  656. in advance by various statements in the install language (i.e. the user does
  657. not actually have to type in the tooltype values).  For example, you could use
  658. an "askchoice" to ask the user what type of screen resolution they want and
  659. then format the tooltype string based on their choice.  The "tooltype"
  660. operation merely asks for a confirmation before actually writing.  Parameters:
  661.  
  662.     prompt, help - as above
  663.     dest - the icon to be modified
  664.     settooltype - the tooltype name and value string.
  665.     setdefaulttool - default tool for a project
  666.     setstack - set size of stack
  667.     noposition - reset to NOICONPOSITION
  668.     swapcolors - swap first two planes of icon's image if OS rev less than v36
  669.     confirm - if this option is present, the user will be asked for
  670.               confirmation, otherwise the modification proceeds
  671.               silently.
  672.     safe - make changes even if in PRETEND mode
  673.  
  674.  
  675. (textfile <parameters>)
  676.  
  677. Creates a text file from other textfiles or computed text strings.  This can be
  678. used to create configuration files, AREXX programs or execute scripts.
  679. Parameters:
  680.  
  681.     help, prompt - as above
  682.     dest - the name of the text file to be created.
  683.     append - a string to be appended to the new text file.
  684.     include - a text file to be appended to the new text file.
  685.     confirm - if this option is present, the user will be asked for
  686.     confirmation, otherwise the writing proceeds silently.
  687.     safe - create file even if in PRETEND mode
  688.  
  689.  
  690. (execute <argument> ...)
  691.  
  692. Executes an AmigaDOS script with the arguments given.  NOTE: Does not ask user
  693. for confirmation, however this can be added by using "askchoice" or "askbool".
  694. Parameters:
  695.  
  696.     help, prompt - as above
  697.     confirm - if this option is present, the user will be asked for
  698.               confirmation, otherwise the execute proceeds silently.
  699.     safe - execute script even if in PRETEND mode
  700.  
  701. Returns a result if executed under 2.0.  Returns 0 under 1.3.  See NOTES for
  702. workarounds under 1.3.
  703.  
  704.  
  705. (run <argument> ...)
  706.  
  707. Executes a compiled program with the arguments given.  NOTE: Does not ask user
  708. for confirmation, however this can be added by using "askchoice" or "askbool".
  709. Parameters:
  710.  
  711.     help, prompt - as above
  712.     confirm - if this option is present, the user will be asked for
  713.               confirmation, otherwise the run proceeds silently.
  714.     safe - run program even if in PRETEND mode
  715.  
  716. Returns a result is executed under 2.0.  Returns 0 under 1.3.  See NOTES for
  717. workarounds under 1.3.
  718.  
  719.  
  720. (rexx <argument> ...)
  721.  
  722. Executes an ARexx script with the arguments given.  NOTE: Does not ask user for
  723. confirmation, however this can be added by using "askchoice" or "askbool".
  724. If the ARexx server is not active, an error will be generated.  Parameters:
  725.  
  726.     help, prompt - as above
  727.     confirm - if this option is present, the user will be asked for
  728.     confirmation, otherwise the rexx script proceeds silently.
  729.     safe - execute script even if in PRETEND mode
  730.  
  731.  
  732. (makeassign <assign> [<path>] (parameters))
  733.  
  734. Assigns 'assign' to 'path'.  If 'path' is not specified, the assignment is
  735. cleared.  Parameters:
  736.  
  737.     safe - assign even if in PRETEND mode
  738.  
  739. Note: assign must be supplied without a colon; i.e. "ENV" not "ENV:".
  740.  
  741.  
  742. (rename <oldname> <newname> <parameters>)
  743.  
  744. Renames a file or directory.  If the "disk" parameter is given, then this
  745. command relabels the disk named oldname to newname.  When relabeling a disk,
  746. ONLY include a colon in the oldname.  Returns 1 if the rename was successful,
  747. 0 if it failed.  Parameters:
  748.  
  749.     help, prompt - as above
  750.     confirm - if this option is present, the user will be asked for
  751.               confirmation, otherwise the rename proceeds silently.
  752.     disk - switch to get rename to relabel a disk.
  753.     safe - rename even if in PRETEND mode
  754.  
  755.  
  756. (delete <file> <parameters>)
  757.  
  758. Delete a file.  Note that a write protected file is considered "delete
  759. protected" as well.  Parameters:
  760.  
  761.     help, prompt - as above
  762.     confirm - if this option is present, the user will be asked for
  763.               confirmation, otherwise the delete proceeds silently.
  764.     (optional <option> <option> ...) - should deletions be forced.
  765.         options:
  766.             "force" - unprotect destination
  767.             "askuser" - ask user if the file should be unprotected
  768.                         (but not in novice)
  769.             In the case of "askuser", the default for novice mode is an answer
  770.             of "no".  Therefore, you may want to use "force" to make the
  771.             novice mode default answer appear to be "yes".
  772.     (delopts <option> <option> ...) - removes options set by "optional"
  773.     safe - delete even if in PRETEND mode
  774.  
  775.  
  776. (protect <file> [<string of flags to change>] [<decimal mask>] <parameters>)
  777.  
  778. Either gets the protection status of a file (if a second argument is not
  779. given), or sets it.  Two methods exist for setting the status: string
  780. (e.g. "+r -w +e -d") or numeric (e.g. 5).  The string method allows the
  781. changing of any of the flags individually, while numeric writes to all flags at
  782. once (possibly changing bits unintendedly).  The bits in the binary
  783. representation of the decimal mask correspond to the flags in the following
  784. manner:
  785.  
  786. 8 7 6 5 4 3 2 1  <- Bit number
  787.  
  788. h s p a r w e d  <- corresponding protection flag
  789.  
  790. ^ ^ ^ ^ ^ ^ ^ ^
  791. | | | | | | | |
  792. | | | | | | | +- \
  793. | | | | | | +--- | 0 = flag set
  794. | | | | | +----- | 1 = flag clear
  795. | | | | +------- /
  796. | | | | 
  797. | | | |
  798. | | | +--------- \
  799. | | +----------- | 0 = flag clear
  800. | +------------- | 1 = flag set
  801. +--------------- /
  802.  
  803. Note that the meaning of the bits in the numeric value follows the DOS
  804. convention that a 1 in the high four bits (flags "hspa") indicates that the
  805. flag is set, while a 1 in the lower four bits (flags "rwed") indicates that
  806. the flag is cleared.
  807.  
  808. When setting bits, "protect" returns 1 if the attempt succeeded, else it
  809. returns a 0.  Getting the bits returns either the numeric value of the
  810. protection status (see interpretation, above) or -1 upon failure.  Parameters:
  811.  
  812.     safe - change protection even if in PRETEND mode
  813.  
  814.  
  815. (abort <message> <message> ...)
  816.  
  817. Exits the installation procedure with the given messages and then processes the
  818. onerror statements (if any).
  819.  
  820.  
  821. (exit <string> <string> ... (quiet))
  822.  
  823. This causes normal termination of a script.  If strings are provided, they are
  824. displayed.  The "done with installation" message is then displayed.  The
  825. "onerror" statements are not executed.  If (quiet) is specified, the final
  826. report display is skipped.
  827.  
  828.  
  829. (complete <number>)
  830.  
  831. This statement is used to inform the user how complete the installation is.
  832. The number (which must be between 0 and 100) will be printed in the title bar
  833. of the installer window with a '%' sign.
  834.  
  835.  
  836. (message <string> <string> ...)
  837.  
  838. This statement displays a message to the user in a window, along with Proceed,
  839. Abort and optional Help buttons.  Note that messages are not printed when
  840. running at user level 0 (novice).  Parameters:
  841.  
  842.     help - optional help text
  843.  
  844.  
  845. (working <string> <string> ...)
  846.  
  847. The strings will be concatenated to form a message which will appear below a
  848. standard line that reads "Working on Installation".  Useful if you are doing a
  849. long operation other than file copying (which has its own status display).
  850.  
  851.  
  852. (welcome <string> <string> ...)
  853. Installer looks for the occurrence of this statement in a script file during
  854. compilation.  If it does not exist (as is the case for older scripts) the
  855. "Welcome to the <APPNAME> App installation utility" display is presented to the
  856. user as soon as compilation has finished. If this statement is present,
  857. Installer will not put up the "Welcome..." display until the (welcome)
  858. statement is reached.  This allows for the execution of code before the first
  859. displays come up.  Note that the state of the "@user-level" and "@pretend"
  860. variables will be based on the initial defaults including any modification by
  861. tooltypes.  The string arguments are prepended to the standard help text for
  862. whichever of the two initial displays appears first.
  863.  
  864.  
  865. 4.3  Control Statements
  866.  
  867. NOTE: Strings can be used as the result of a test expression.  An empty string
  868. is considered a FALSE value, all others are considered TRUE.
  869.  
  870. (if <expression> <true-statement> <false-statement>)
  871.  
  872. Operates as a standard "if-then" statement.
  873.  
  874.  
  875. (while <expression> <statement> ... )
  876.  
  877. Operates as a standard "do-while" statement.
  878.  
  879.  
  880. (until <expression> <statement> ... )
  881.  
  882. Operates as a standard "do-until" statement.
  883.  
  884.  
  885. (foreach <drawer name> <pattern> <statement>)
  886.  
  887. For each file or directory matching the pattern located in the given drawer
  888. statement will be executed.  The special variables "@each-name" and
  889. "@each-type" will contain the filename and the DOS object type, respectively.
  890. (By DOS object type we mean the same value as found in fib_DirEntryType if one
  891. were to "Examine" the object.) Patterns specified in a script must be no longer
  892. than 64 characters.
  893.  
  894.  
  895. ((...) (...) (...))
  896.  
  897. Execute a sequence of statements.  The statements in the parentheses will be
  898. executed in order -- not needed at topmost level.
  899.  
  900.  
  901. (trap <trapflags> <statements>)
  902.  
  903. Used for catching errors.  Works much like C "longjmp", i.e.  when an error
  904. occurs, control is passed to the statement after "trap".  "Trapflags" determine
  905. which errors are trapped.  The trap statement itself returns the error type or
  906. zero if no error occurred.  The current error type values are:
  907.  
  908.     1 - user aborted
  909.     2 - ran out of memory
  910.     3 - error in script
  911.     4 - DOS error (see @ioerr below)
  912.     5 - bad parameter data
  913.  
  914.  
  915. (onerror <statements>)
  916.  
  917. When a fatal error occurs that was not trapped, a set of statements can be
  918. called to clean-up after the script.  These statements are logged in by using
  919. the onerror construct.  Note that onerror can be used multiple times to allow
  920. context sensitive termination.
  921.  
  922.  
  923. (select <n> <item1> <item2> ...)
  924. Only the selected element will be evaluated.  In this manner, "select" can be
  925. used as a case select construct.
  926.  
  927.  
  928. 4.4  Debugging Statements
  929.  
  930. (user <user-level>)
  931.  
  932. Used to change the user level of the current installation.  This statement
  933. should ONLY be used when debugging scripts.  Remove such statements from any
  934. script before distribution of your product.  Returns the current user level.
  935.  
  936.  
  937. (debug <anything> <anything> ...)
  938.  
  939. When the Installer is run from a CLI, "debug" will print the values of the
  940. parameters with a space between each parameter.  For example, the statements
  941.  
  942.     (set myvar 2)
  943.     (debug "This value of 'myvar' is" myvar)
  944.  
  945. will print "This value of myvar is 2".  If the parameter is an uninitialized
  946. variable, then debug will print "<NIL>" as its value.
  947.  
  948.  
  949.  
  950.  
  951. 4.5  User-Defined Procedures
  952. The Installer has user-defined procedures (subroutines).  This functionality
  953. is currently very primative.  There are no local variables.  To define a new
  954. procedure, use the "procedure" command:
  955.  
  956.     (procedure <procedure-name> <statement>)
  957.  
  958. You can then call the procedure like so:
  959.  
  960.     (<procedure-name>)
  961.  
  962. Note that <procedure-name> is not a string, just a symbolic name.
  963.  
  964.  
  965. 4.6  Functions
  966.  
  967.  
  968. (<string> <arguments> ...)
  969.  
  970. The "string substitution function".  Whenever a text string is the first item
  971. in a parenthesized group, the arguments will be substituted into the string
  972. using RawDoFmt.  Note: This function does no argument type checking.
  973.  
  974.  
  975. (cat <string> <string> ...)
  976.  
  977. Concatenates the strings and returns the resulting string.
  978.  
  979. To convert an integer to a string, use the "cat" function.  All integer
  980. arguments to "cat" are converted to strings during concatenation.  Use the
  981. "set" statement to convert a string to an integer.
  982.  
  983.  
  984. (substr <string> <start> [<count>])
  985.  
  986. Returns a substring of <string>, beginning with the character at offset <start>
  987. (offset begins with 0 for the first character) and including <count> characters.
  988. If <count> is omitted, the rest of the string (to its end) is returned.
  989.  
  990.  
  991. (strlen <string>)
  992.  
  993. Returns the length of the given string.
  994.  
  995.  
  996. (transcript <string> <string> ...)
  997.  
  998. Concatenates the strings, appends a newline and then prints the resulting
  999. string to the transcript file (if any).
  1000.  
  1001.  
  1002. (tackon <path> <file>)
  1003.  
  1004. Concatenates the filename to the pathname and returns resulting string.
  1005. Currently, "tackon" cannot deal with a leading '/' in the <file> parameter.
  1006. This may be fixed in a future version.
  1007.  
  1008.  
  1009. (fileonly <path>)
  1010.  
  1011. Returns only the file part of a pathname.
  1012.  
  1013.  
  1014. (pathonly <path>)
  1015.  
  1016. Returns only the non-file part of a pathname.
  1017.  
  1018.  
  1019. (expandpath <path>)
  1020.  
  1021. Returns the full path, given a shortened path.  For example, it might expand
  1022. "SYS:c" to "System2.x:c".
  1023.  
  1024.  
  1025. (askdir <parameters>)
  1026.  
  1027. Asks the user for a directory name, with a scrolling list requester.  The user
  1028. can either create a new directory or specify an existing one.  If the user
  1029. cancels, the routine will cause an abort.  NOTE: It is always best to first
  1030. insure that the volume you want is mounted by using the "askdisk" command.
  1031. Parameters:
  1032.  
  1033.     prompt, help - as above
  1034.     default - default name of directory to be selected.  Note that this may be
  1035.               a relative pathname.
  1036.     newpath - allows non-existent paths to be supplied as the default drawer.
  1037.     disk - show drive list first.
  1038.     assigns - debugging parameter; indicates that logical assigns should
  1039.               satisfy requests as well.  Remove this parameter before
  1040.               distributing disk.
  1041.  
  1042.  
  1043.  
  1044. (askfile <parameters>)
  1045.  
  1046. Asks the user for a file name, with a scrolling list requester.  The default
  1047. path can be either reference a file or a drawer.  If a file, the filename
  1048. gadget is filled in.  Parameters:
  1049.  
  1050.     prompt, help - as above
  1051.     newpath - allows non-existent paths to be supplied as the default drawer.
  1052.     disk - show drive list first.
  1053.     default - default name of file to be selected  Note that this may be
  1054.               a relative pathname.
  1055.  
  1056.  
  1057. (askstring <parameters>)
  1058.  
  1059. Prompts the user to enter a text string.  Parameters:
  1060.  
  1061.     prompt, help - as above
  1062.     default - the default text string.
  1063.  
  1064.  
  1065. (asknumber <parameters>)
  1066.  
  1067. Prompts the user to enter an integer quantity.  Prints the allowed range below
  1068. the integer gadget if the "range" parameter is given, and prevents the user
  1069. from proceeding without entering a valid number.  Parameters:
  1070.  
  1071.     prompt, help - as above
  1072.     range - valid input range of numbers
  1073.     default - default value
  1074.  
  1075.  
  1076. (askchoice <parameters>)
  1077.  
  1078. Ask the user to select one out of N choices, using radio buttons.  Parameters:
  1079.  
  1080.     prompt, help - as above
  1081.     choices - a list of choice strings, such as "ok" "cancel", etc.
  1082.     default - the number of the default choice (defaults to 0)
  1083.  
  1084.  
  1085. (askoptions <parameters>)
  1086.  
  1087. Ask the user to select any number of N choices, using checkbox buttons.  A bit
  1088. mask is returned as a result, with the first bit indicating the state of the
  1089. first choice, etc.  Parameters:
  1090.  
  1091.     prompt, help - as above
  1092.     choices - a list of choice strings, such as "ok" "cancel", etc.
  1093.     default - a bit mask of the buttons to be checked (defaults to -1)
  1094.  
  1095.  
  1096. (askbool <parameters>)
  1097.  
  1098. Ask the user to select yes or no.  Parameters:
  1099.  
  1100.     prompt, help - as above
  1101.     default - 0 = no, 1 = yes
  1102.         choices - change the positive and negative text.  The defaults are
  1103.         "Yes" and "No".  So to change the text to "Proceed" and "Cancel"
  1104.         you would use: (choices "Proceed" "Cancel")
  1105.  
  1106.  
  1107. (askdisk <parameters>)
  1108.  
  1109. Ask the user to insert a disk in a user friendly manner.  For instance, the
  1110. prompt can describe the disk by its label; e.g. "FooBar Program Disk".  This
  1111. function will not exit until the correct disk is inserted, or the user aborts.
  1112.  
  1113.     prompt, help - as above
  1114.         dest - the volume name of the disk to be inserted
  1115.     newname - a name to assign to the disk for future reference.
  1116.               This assignment is done even in Dry Run mode -- it is considered
  1117.               "safe" disk - switch to get a drive list to be shown initially.
  1118.     assigns - Debugging option; this indicates that logical assigns should
  1119.               satisfy the request as well.  Remove this parameter before
  1120.               distributing disk.
  1121.     Note: volume name must be supplied without a colon; i.e. "ENV" not "ENV:".
  1122.  
  1123.  
  1124. (exists <filename> (noreq))
  1125.  
  1126. Returns 0 if does not exists, 1 if a file, and 2 if a directory.  If noreq is
  1127. specified, no requester is displayed if the path given is not on a mounted
  1128. volume.  In this case the result is 0.
  1129.  
  1130.  
  1131. (earlier <file-1> <file-2>)
  1132.  
  1133. Returns TRUE if file-1 is earlier than file-2.
  1134.  
  1135.  
  1136. (getsize <filename>)
  1137.  
  1138. Returns the size of a file.
  1139.  
  1140.  
  1141. (getdevice <path>)
  1142.  
  1143. returns the name of the device upon which <path> resides. For example,
  1144. "c:mount" as a path might return "WB_2.x".
  1145.  
  1146.  
  1147. (getdiskspace <pathname>)
  1148.  
  1149. Returns the available space in bytes on the disk given by pathname.  Returns -1
  1150. if the pathname is bad or information could not be obtained from the filesystem
  1151. (even though pathname was valid).
  1152.  
  1153.  
  1154. (getsum <filename>)
  1155.  
  1156. Returns the checksum of a file, for comparing versions.
  1157.  
  1158.  
  1159. (getversion <filename> (resident))
  1160.  
  1161. If the named file has a RomTag with an ID string or a 2.x version string, this
  1162. will return the version number.  If filename is not provided, then the version
  1163. of the OS is returned instead.  Note that this function does NOT assume files
  1164. ending with ".library" or ".device" reside in a particular place -- the path
  1165. must be included. If "resident" is specified, attempts to return version of
  1166. library or device in memory.  For example:
  1167.  
  1168.     (getversion "intuition.library" (resident))
  1169.  
  1170. would return the version/revision of intuition.  Note that using the "resident"
  1171. parameter causes first the library and then the device list to be checked.
  1172.  
  1173. The version number is returned as a 32 bit value, where the high order 16 bit
  1174. word is the version and the low order word is the revision.  Here is some sample
  1175. statements to parse a version number:
  1176.  
  1177. (set vernum (getversion "c:iconx"))
  1178. (set ver (/ vernum 65536))
  1179. (set rev (- vernum (* ver 65536) ) )
  1180.  
  1181. (message
  1182.         ("You have version %ld.%ld" ver rev)
  1183. )
  1184.  
  1185.  
  1186. (getenv <name>)
  1187.  
  1188. Returns the contents of the given ENV: variable.
  1189.  
  1190.  
  1191. (getassign <name> <opts>)
  1192.  
  1193. Returns the pathname of the object 'name'.  The default is for logical
  1194. assignments only, but can be changed using an options string where the
  1195. characters are:
  1196.  
  1197.     'v' - only match volumes
  1198.     'a' - only match logical assignments
  1199.     'd' - only match devices
  1200.  
  1201. Therefore 'a' would be equivalent to having no options.  Returns an empty string
  1202. on failure.
  1203.  
  1204. Notes: Name must be supplied without a colon; i.e. "ENV" not "ENV:".  A variable
  1205.        previously set to name may be used in place of name.  If a device name is
  1206.        used as the name and the search is limited to devices, then "getassign"
  1207.        will return the device or volume name if the device exists, otherwise it
  1208.        will return an empty string. An example usage would be
  1209.        (getassign "df1" "d").
  1210.  
  1211.  
  1212. (database <feature>)
  1213.  
  1214. Returns information about the Amiga that the Installer is running on.  "Feature"
  1215. is a string.  This function always returns a string result, even if the result
  1216. looks like a number.  If the feature requested is not recognized, the function
  1217. returns "unknown".  The currently understood features and their possible values
  1218. are:
  1219.  
  1220.     "vblank": "50", "60"
  1221.     "cpu": "68000", "68010", "68020", "68030", "68040"
  1222.     "graphics-mem": [returns a string representing the amount of free
  1223.                     graphics memory]
  1224.     "total-mem": [returns a string representing the total amount of
  1225.                  free memory]
  1226.     "chiprev": "AGNUS" [implies original chip set], "ECS", "AA"
  1227.  
  1228.  
  1229. (select <n> <item1> <item2> ...)
  1230.  
  1231. Returns the value of the Nth item.
  1232.  
  1233.  
  1234. (patmatch <pattern> <string>)
  1235. Determines if a string matches an AmigaDOS pattern.  Returns either TRUE or
  1236. FALSE.
  1237.  
  1238.  
  1239. (=  <expression-1> <expression-2>)
  1240. (>  <expression-1> <expression-2>)
  1241. (>= <expression-1> <expression-2>)
  1242. (<  <expression-1> <expression-2>)
  1243. (<= <expression-1> <expression-2>)
  1244. (<> <expression-1> <expression-2>)
  1245.  
  1246. These are the standard relational expressions.
  1247.  
  1248.  
  1249. (+  <expression> ...)
  1250.  
  1251. Returns the sum of all the arguments.
  1252.  
  1253.  
  1254. (-  <expression-1> <expression-2>)
  1255.  
  1256. Returns the first argument minus the second argument
  1257.  
  1258.  
  1259. (* <expression> ...)
  1260.  
  1261. Returns the product of all the arguments
  1262.  
  1263.  
  1264. (/  <expression-1> <expression-2>)
  1265.  
  1266. Returns the first argument divided by the second argument
  1267.  
  1268.  
  1269. (AND <expression-1> <expression-2>)
  1270. (OR  <expression-1> <expression-2>)
  1271. (XOR <expression-1> <expression-2>)
  1272. (NOT <expression>)
  1273.  
  1274. Standard logical functions
  1275.  
  1276.  
  1277. (BITAND <expression-1> <expression-2>)
  1278. (BITOR  <expression-1> <expression-2>)
  1279. (BITXOR <expression-1> <expression-2>)
  1280. (BITNOT <expression>)
  1281.  
  1282. Bitwise versions of the standard logical functions
  1283.  
  1284.  
  1285. (shiftleft <number> <amount to shift>)
  1286. (shiftrght <number> <amount to shift>)
  1287.  
  1288. These functions perform a bit-oriented shift by the amount specified.  Zeros
  1289. are shifted in on the opposite side.
  1290.  
  1291.  
  1292. (IN  <expression> <bit number-1> ...)
  1293.  
  1294. Returns 0 if none of the given bit numbers (starting at 0 for the LSB) is set
  1295. in the result of expression, else returns a mask of the bits that were set.
  1296.  
  1297.  
  1298. 4.7  Summary of Parameters
  1299.  
  1300.  
  1301. (assigns)
  1302.  
  1303. A debug option used in the "askdisk" statement to indicate that logical assigns
  1304. will match the askdisk request as well.  This parameter should not be used for
  1305. final disks, only for debugging.
  1306.  
  1307.  
  1308. (help <string-1> <string-2> ...)
  1309.  
  1310. This is used to specify the help text for each action.
  1311.  
  1312.  
  1313. (prompt <string-1> <string-2> ...)
  1314.  
  1315. This is used to provide the "title" of the screen which explains to the user
  1316. what this step does.
  1317.  
  1318.  
  1319. (safe)
  1320.  
  1321.     This tells the installer that an action not normally performed in Pretend
  1322. mode should be performed.
  1323.  
  1324.  
  1325. (choices <string-1> <string-2> ...)
  1326.  
  1327. Used to display a series of checkmarks.  This is used in the "askchoice"
  1328. function to indicate what choices the user has.  It can also be used in the
  1329. "copyfiles" statement to specify that only certain files can be copied. (If
  1330. absent, some other criterion will be used to determine which files to copy).
  1331.  
  1332.  
  1333. (pattern <string>)
  1334.  
  1335. Used in the "copyfiles" statement to specify a wildcard pattern.
  1336.  
  1337.  
  1338. (all)
  1339.  
  1340. In the "copyfiles" statement, specifies that all files are to be copied.
  1341.  
  1342.  
  1343. (source <filename>)
  1344.  
  1345. Specifies the file or directory to be read as part of this command.
  1346.  
  1347.  
  1348. (dest <filename>)
  1349.  
  1350. Specifies the file or directory to be modified as part of the command.
  1351.  
  1352.  
  1353. (newname <name>)
  1354.  
  1355. Used in "copyfiles" to specify that a file will have a new name after being
  1356. copied.  Used in "askdisk" to assign the new name to the inserted disk. Used in 
  1357. "copylib" to specify that the library will have a new name after being copied.
  1358.  
  1359.  
  1360. (newpath)
  1361.  
  1362. Used by "askdir" and "askfile" to allows non-existent paths to be supplied as
  1363. the default drawer.
  1364.  
  1365.  
  1366. (confirm <user-level>)
  1367.  
  1368. On some statements, the user will only be informed of the action (and allowed to
  1369. cancel it) if the "confirm" option is specified.  The user level can be "expert"
  1370. or "average" ("expert" is the default).
  1371.  
  1372.  
  1373. (infos)
  1374.  
  1375. Indicates to the "copyfiles" statement that accompanying ".info" files are to be
  1376. copied as well.  If the destination drawer does not exist, a default icon will
  1377. be made for the drawer the Installer creates.
  1378.  
  1379.  
  1380. (fonts)
  1381.  
  1382. Indicates to the "copyfiles" statement that accompanying ".font" files are to be
  1383. copied as well.
  1384.  
  1385.  
  1386. (optional <option> <option> ...)
  1387.  
  1388. Indicates to the "copyfiles" and "copylib" statements that it is not a fatal
  1389. error to have a copy fail.  Used for "delete" to indicate if deletion should be
  1390. "forced".
  1391.  
  1392.  
  1393. (delopts <option> <option> ...)
  1394.  
  1395. Indicates to the "copyfiles", "copylib" and "delete" statements that the listed
  1396. options should be _removed_ from the global internal list of options for this
  1397. statement.  The default global option is "fail".
  1398.  
  1399.  
  1400. (nogauge)
  1401. When used with the "copyfiles" and "copylib" statements this disables the copy
  1402. status indicator.
  1403.  
  1404.  
  1405. (settooltype <tooltype> <value>)
  1406.  
  1407. Used to modify a tooltype to a certain value.  If the tooltype does not exist
  1408. it will be created; if the <values> parameter is omitted, the tooltype will be
  1409. deleted.  A tooltype without a value may be added in the following manner:
  1410.  
  1411.     (settooltype <tooltype-string> "")
  1412.  
  1413. Remember that (tooltype <tooltype-string>) deletes the tooltype given.
  1414.  
  1415.  
  1416. (setdefaulttool <value>)
  1417.  
  1418. Used to modify the default tool of an icon.
  1419.  
  1420.  
  1421. (setstack <value>)
  1422.  
  1423. Used to modify the stack size included in an icon.
  1424.  
  1425.  
  1426. (noposition)
  1427.  
  1428. Used to modify the positioning of an icon to NO_ICON_POSITION.
  1429.  
  1430.  
  1431. (swapcolors)
  1432.  
  1433. Used to swap the first two planes of the image of the icon being modified if
  1434. the version of the OS if less than 36 (i.e., prior to version 2.0).  This does
  1435. mean that your icons need to have the 2.0 color scheme on your distribution
  1436. disks.
  1437.  
  1438.  
  1439. (disk)
  1440.  
  1441. When used with the "rename" statement, specifies that a disk relabel operation
  1442. is really desired.  When used with the "askdir" or "askfile" statement,
  1443. specifies that a drive list should be shown initially (instead of a file list).
  1444.  
  1445.  
  1446. (append <string>)
  1447.  
  1448. Within a "textfile" statement, will append the string to the textfile.
  1449.  
  1450.  
  1451. (include <filename>)
  1452.  
  1453. Within a "textfile" statement, will append the listed file to the textfile.
  1454.  
  1455.  
  1456. (default <value>)
  1457.  
  1458. Specifies the default value of an askchoice, askstring, or asknumber action.
  1459.  
  1460.  
  1461. (range <min> <max>)
  1462.  
  1463. Specifies the range of allowable numbers for an asknum statement.
  1464.  
  1465.  
  1466. (command <text> ...)
  1467.  
  1468. Specifies the text of a command to be inserted into the S:User-Startup file.
  1469. (Argument strings are merged.)
  1470.  
  1471.  
  1472. 4.9  Pre-Defined Variables
  1473.  
  1474. Pre-defined variables are available for use by the install script.  They may be
  1475. modified on-the-fly, but their type may not be changed (e.g. from strings to
  1476. numeric) unless it never had a value to begin with.
  1477.  
  1478.  
  1479. @abort-button
  1480.     Replacement text for the "Abort Install" button.
  1481.  
  1482. @app-name
  1483.     The APPNAME value given at startup.
  1484.  
  1485. @icon
  1486.     The pathname of the icon used to start the installer.
  1487.  
  1488. @execute-dir
  1489.     If this variable is set to a valid path, then the installer will change
  1490. directory to it whenever a "run" or "execute" statement is performed.
  1491.  
  1492. @default-dest
  1493.     The installer's suggested location for installing an application.  If you
  1494. installed the application somewhere else (as the result of asking the user)
  1495. then you should modify this value -- this will allow the "final" statement to
  1496. work properly.  Note that creating a drawer and putting the application in that
  1497. drawer is considered installing the application somewhere else.  Set it to ""
  1498. if there really is no definite place that the "application" was installed.
  1499. The log file will be copied to the drawer indicated by @default-dest unless it
  1500. was set to "".
  1501.  
  1502. @language
  1503.     Used to set the variable @language (default for @language is "english".
  1504. Installer will attempt to load the corresponding language catalog to allow for
  1505. language localization.
  1506.  
  1507. @pretend
  1508.     The state of the Pretend flag (1 if Pretend mode).
  1509.  
  1510. @user-level
  1511.     The user-level the script is being run at: 0 for novice, 1 for average,
  1512. 2 for expert.
  1513.  
  1514. @error-msg
  1515.     The text that would have been printed for a fatal error, but was overridden
  1516. by a trap statement.
  1517.  
  1518. @special-msg
  1519.     If a script wants to supply its own text for any fatal error at various
  1520. points in the script, this variable should be set to that text.  The original
  1521. error text will be appended to the special-msg within parenthesis.  Set this
  1522. variable to "" to clear the special-msg handling.
  1523.  
  1524. @ioerr
  1525.     The value of the last DOS error.  Can be used in conjunction with the
  1526. "trap" statement to learn more about what an error occurred.
  1527.  
  1528. @each-name
  1529. @each-type
  1530.     Used in a "foreach" loop (see above).
  1531.  
  1532. @askoptions-help
  1533. @askchoice-help
  1534. @asknumber-help
  1535. @askstring-help
  1536. @askdisk-help
  1537. @askfile-help
  1538. @askdir-help
  1539. @copylib-help
  1540. @copyfiles-help
  1541. @makedir-help
  1542. @startup-help
  1543.     Default help text for various functions.  These can be appended to the
  1544. explanation provided for a particular action or used as is.
  1545.  
  1546.  
  1547.             Section 5: Installer Language Quick Reference
  1548.  
  1549. 5.1  Overview
  1550.  
  1551.     Attempts to install in "work:" by default if it exists.
  1552.     HELP key brings up context-sensitive help.
  1553.     Esc key brings up the abort requester.
  1554.     Can add assigns to s:User-Startup, and adds lines to
  1555.     s:Startup-Sequence (if necessary) to make sure s:User-Startup is executed
  1556.       upon boot-up.
  1557.     Can check versions of files/libraries.
  1558.     Install can run in "Real" (do it) or "Pretend" (dry run) modes.
  1559.  
  1560.  
  1561.  
  1562.  
  1563. 5.2  Quick Language Overview
  1564.  
  1565.     Language is lisp-like (lots of parentheses (()) (-:).
  1566.     Variables are typeless (a la ARexx), i.e., strings and numbers are treated
  1567.       interchangeably.
  1568.     Strings are delimited with " or '.
  1569.     Certain embedded sequences are available for strings:
  1570.         '\n'    newline        '\r'    return
  1571.         '\t'    tab            '\0'    NULL
  1572.         '\"'    double-quote   '\\'    backslash
  1573.     Statements go in parentheses ( ).  The general format is:
  1574.         (operator <operand1> <operand2> ...)
  1575.     E.g., to assign the value '5' to the variable 'x', use
  1576.         (set x 5)
  1577.     To produce the sum of two numbers, use
  1578.         (+ 5 9)
  1579.     Note that there is no difference between operators and functions-- the
  1580.       function 'set' and the arithmetic operator '+' are both used exactly the
  1581.       same way.
  1582.     Combining statements: A statement can be used as the operand to another
  1583.       statement.  E.g.:
  1584.         (set x (+ 3 5))
  1585.       In this case, the statement '(+ 3 5)' is evaluated first, and the result
  1586.       is 8.  You can think of this as having the '(+ 3 5)' part being replaced
  1587.       by an 8, leaving:
  1588.         (set v 8)
  1589.       Note that the '(+ 3 5)' part actually produced a value: "8".  This is
  1590.       called the "result" of the statement.  Many statements return results,
  1591.       even some that might surprise you (such as "set" and "if").
  1592.     Comments are preceded with a semi-colon ";"
  1593.     Hex numbers are preceded with a $ (e.g. $23).
  1594.     Binary numbers are preceded with a % (e.g. %0101).
  1595.     Many statements return a value which can be used in assignments, tests, etc.
  1596.     Data can be formatted using a string literal with argument placemarkers,
  1597.       for example:
  1598.         ("I am %ld foot %ld inches tall." 6 3)
  1599.         ;Produces a string with %ld's replaced with 6 and 3.
  1600.         ;Remember that decimal values must be specified as longwords.
  1601.  
  1602.  
  1603.  
  1604.  
  1605. 5.3  Pre-Defined Variables
  1606.  
  1607.     @icon - pathname of install script icon
  1608.     @execute-dir -  installer will change to this directory before performing
  1609.       a "run" or "execute" statement.
  1610.     @default-desk - dir.  where install wants to put things by default
  1611.     @pretend - state of "pretend" (dry run mode) flag 0-Real, 1-Pretend
  1612.     @language - language specified in tooltypes/CLI (default "english")
  1613.     @user-level - 0-Novice, 1-Average, 2-Expert
  1614.     @error-msg - msg that would be displayed if error not trapped (see trap)
  1615.     @special-msg - custom fatal error message
  1616.     @each-name, @each-type - used in "foreach" loop
  1617.     @execute-dir - If set to a valid path, installer will change directory to
  1618.       it whenever a "run" or "execute" statement is performed.
  1619.  
  1620.  
  1621.  
  1622.  
  1623. 5.4  Default Help String Variables
  1624.  
  1625.     @askoptions-help    @askchoice-help      @asknumber-help
  1626.     @askstring-help     @askdisk-help        @askfile-help
  1627.     @askdir-help        @copylib-help        @copyfiles-help
  1628.     @makedir-help       @startup-help
  1629.  
  1630.  
  1631.  
  1632. 5.5  Statements
  1633.  
  1634. Many commands have standard parameters (some optional):
  1635.     (all) ; specifies all files are to copied
  1636.     (append <string>) ; add string to text file (for textfile)
  1637.     (choices <string1> <string2> ...) ; radio button options
  1638.     (command <string1> <string2>...) ; add to s:user-startup
  1639.     (confirm <user-level>) ; confirmation
  1640.     (default <value>) ; default value, choice, string, etc.
  1641.     (dest <file>) ; output to <file>
  1642.     (help <string1> <string2> ...) ; define current help info
  1643.     (include <file>) ; insert file in textfile statement
  1644.     (infos) ; copy .info files also
  1645.     (newname <name>) ; specify new file or disk name
  1646.     (noposition) ; make icon "floating"
  1647.     (pattern <string>) ; used w/ "files" for patterns
  1648.     (prompt <string1> <string2> ...) ; text to show user
  1649.     (range <min> <max>) ; numeric input (asknum) range
  1650.     (safe) ; force installer to perform action even if in Pretend mode.
  1651.     (settooltype <tooltype> <value>) ; set icon tool type
  1652.     (setdefaulttool <value>) ; set icon's default tool
  1653.     (setstack <value>) ; set icon's stack value
  1654.     (source <file>) ; read from <file>
  1655.     (swapcolors) ; swap first two planes of icon's image if OS rev less than v36
  1656.     (welcome <string> <string> ...) ; Invokes "welcome" display
  1657.  
  1658. Note: Custom parameters are shown below in < >, and standard parameters are
  1659. show as (param..) where "param" is one of help, prompt, safe, etc.  See above
  1660. for details on standard parameters.
  1661.  
  1662.  
  1663. (abort <string1> <string2> ...)
  1664.   ; abandon installation
  1665.  
  1666. (complete <num>)
  1667.   ; display percentage through install in titlebar
  1668.  
  1669. (copyfiles (prompt..) (help..) (source..) (dest..) (newname..) (choices..)
  1670.   (all) (pattern..) (files) (infos) (confirm..) (safe)
  1671.   (optional <option> <option> ...) (delopts <option> <option> ...) (nogauge))
  1672.   ; copy files (and subdir's by default).  files option say NO subdirectories
  1673.  
  1674. (copylib (prompt..) (help..) (source..) (dest..) (newname..) (infos) (confirm)
  1675.   (safe) (optional <option> <option> ...) (delopts <option> <option> ...)
  1676.   (nogauge))
  1677.   ; install a library if newer version
  1678.  
  1679. (delete file (help..) (prompt..) (confirm..) (optional <option> <option> ...)
  1680.   (delopts <option> <option> ...) (safe))
  1681.   ; delete file
  1682.  
  1683. (execute <arg> (help..) (prompt..) (confirm) (safe))
  1684.   ; execute script file
  1685.  
  1686. (exit <string> <string> ... (quiet))
  1687.   ; end installation after displaying strings (if provided)
  1688.  
  1689. (foreach <dir> <pattern> <statements>)
  1690.   ;do for entries in directory
  1691.  
  1692. (if expr truestatements falsestatements)
  1693.   ; conditional
  1694.  
  1695. (makeassign <assign> <path> (safe)) ; note: <assign> doesn't need `:'
  1696.   ; create an assignment
  1697.  
  1698. (makedir <name> (prompt..) (help..) (infos) (confirm..) (safe))
  1699.   ; make a directory
  1700.  
  1701. (message <string1> <string2>...)
  1702.   ; display message with Proceed, Abort buttons
  1703.  
  1704. (onerror (<statements>))
  1705.   ; general error trap
  1706.  
  1707. (protect <file> [<string of flags to change>] [<decimal mask>] <parameters>)
  1708.   ; Get/Set file protection flags
  1709.  
  1710. (rename <old> <new> (help..) (prompt..) (confirm..) (safe))
  1711.   ; rename files
  1712.  
  1713. (rexx <arg> (help..) (prompt..) (confirm..) (safe))
  1714.   ; execute ARexx script
  1715.  
  1716. (run <arg> (help..) (prompt..) (confirm..) (safe))
  1717.   ; execute program
  1718.  
  1719. (set <varname> <expression>)
  1720.   ; assign a value to a variable
  1721.  
  1722. (startup (prompt..) (command..))
  1723.   ; add a command to the boot scripts (startup-sequence, user-startup)
  1724.  
  1725. (textfile (prompt..) (help..) (dest..) (append) (include..) (confirm..) (safe))
  1726.   ; create text file from other text files and strings
  1727.  
  1728. (tooltype (prompt..) (help..) (dest..) (settooltype..) (setstack..)
  1729.   (setdefaulttool..) (noposition) (confirm..) (safe))
  1730.   ; modify an icon
  1731.  
  1732. (trap <flags> <statements>)
  1733.   ; trap errors.  flags: 1-abort, 2-nomem, 3-error, 4-dos, 5-badargs
  1734.  
  1735. (until <expr> <statements>)
  1736.   ; do-until conditional structure (test end of loop)
  1737.  
  1738. (welcome <string> <string> ...)
  1739.   ; Allow Installation to commence.
  1740.  
  1741. (while <expr> <statements>)
  1742.   ; do-while conditional structure (test top of loop)
  1743.  
  1744. (working)
  1745.   ; indicate to user that installer is busy doing things
  1746.  
  1747.  
  1748. 5.6  Functions
  1749.  
  1750. (= <expr1> <expr2>) ; equality test (returns 0 or 1)
  1751.  
  1752. (> <expr1> <expr2>) ; greater than test (returns 0 or 1)
  1753.  
  1754. (>= <expr1> <expr2>) ; greater than or equal test (returns 0 or 1)
  1755.  
  1756. (< <expr1> <expr2>) ; less than test (returns 0 or 1)
  1757.  
  1758. (<= <expr1> <expr2>) ; less than or equal test
  1759.  
  1760. (+ <expr1> <expr2> ...) ; returns sum of expressions
  1761.  
  1762. (- <expr1> <expr2>) ; returns <expr1> minus <expr2>
  1763.  
  1764. (* <expr1> <expr2> ...) ; returns product of expressions
  1765.  
  1766. (/ <expr1> <expr2>) ; returns <expr1> divided by <expr2>
  1767.  
  1768. (AND <expr1> <expr2>) ; returns logical AND of <expr1> and <expr2>
  1769.  
  1770. (OR <expr1> <expr2>) ; returns logical OR of <expr1> and <expr2>
  1771.  
  1772. (XOR <expr1> <expr2>) ; returns logical XOR of <expr1> and <expr2>
  1773.  
  1774. (NOT <expr>) ; returns logical NOT of <expr>
  1775.  
  1776. (BITAND <expr1> <expr2>) ; returns bitwise AND of <expr1> and <expr2>
  1777.  
  1778. (BITOR <expr1> <expr2>) ; returns bitwise OR of <expr1> and <expr2>
  1779.  
  1780. (BITXOR <expr1> <expr2>) ; returns bitwise XOR of <expr1> and <expr2>
  1781.  
  1782. (BITNOT <expr>) ; returns bitwise NOT of <expr>
  1783.  
  1784. (shiftleft <number> <amount to shift>) ; logical shift left
  1785.  
  1786. (shiftrght <number> <amount to shift>) ; logical shift right
  1787.  
  1788. (IN <expr> <bit-number> <bitnumber>...)    ; returns <expr> AND bits
  1789.  
  1790. (<format string> <arg1> <arg2> ...) ; printf clone
  1791.  
  1792. (askdir (prompt..) (help..) (default..) (newpath) (disk))
  1793.   ; ask for directory name
  1794.  
  1795. (askfile (prompt..) (help..) (default..) (newpath) (disk))
  1796.   ; ask for file name
  1797.  
  1798. (askstring (prompt..) (help..) (default..)) ; ask for a string
  1799.  
  1800. (asknumber (prompt..) (help..) (range..) (default..)) ; ask for a number
  1801.  
  1802. (askchoice (prompt..) (choices..) (default..)) ; choose 1 options
  1803.  
  1804. (askoptions (prompt (help..) (choices..) default..)) ; choose n options
  1805.  
  1806. (askbool (prompt..) (help..) (default..) (choices..)) ; 0=no, 1=yes
  1807.  
  1808. (askdisk (prompt..) (help..) (dest..) (newname..) (assigns))
  1809.  
  1810. (cat <string1> <string2>...) ; returns concatenation of strings
  1811.  
  1812. (exists <filename> (noreq)) ; 0 if no, 1 if file, 2 if dir
  1813.  
  1814. (expandpath <path>) ; Expands a short path to its full path equivalent
  1815.  
  1816. (earlier <file1> <file2>) ; true if file1 earlier than file2
  1817.  
  1818. (fileonly <path>) ; return file part of path (see pathonly)
  1819.  
  1820. (getassign <name> <opts>) ; return value of logical name (no `:')
  1821.   ; <opts: 'v'-volumes, 'a'-logical, 'd'-devices
  1822.  
  1823. (getdevice <path>) ; returns name of device upon which <path> resides
  1824.  
  1825. (getdiskspace <path>) ; return available space
  1826.  
  1827. (getenv <name>) ; return value of environment variable
  1828.  
  1829. (getsize <file>) ; return size
  1830.  
  1831. (getsum <file>) ; return checksum of file for comparison purposes
  1832.  
  1833. (getversion <file> (resident))
  1834.   ; return version/revision of file, library, etc. as 32 bit num
  1835.  
  1836. (pathonly <path>) ; return dir part of path (see fileonly)
  1837.  
  1838. (patmatch <pattern> <string>) ; Does <pattern> match <string> ? TRUE : FALSE
  1839.  
  1840. (select <n> <item1> <item2> ...) ; return n'th item
  1841.  
  1842. (strlen <string>) ; string length
  1843.  
  1844. (substr <string> <start> [<count>]) ; returns a substring of <string>
  1845.  
  1846. (transcript <string1> <string2>) ; puts concatenated strings in log file
  1847.  
  1848. (tackon <path> <file>) ; return properly concatenated file to path
  1849.  
  1850.